package org.vaadin.golfscoretracker.ui.views;

import org.vaadin.appfoundation.i18n.Lang;
import org.vaadin.golfscoretracker.data.Course;
import org.vaadin.golfscoretracker.ui.components.CourseFieldFactory;
import org.vaadin.golfscoretracker.ui.controller.CourseController;

import com.vaadin.ui.FormFieldFactory;

public class CoursesView extends AbstractDataEditorView<Course> {

    public CoursesView() {
        super(new CourseController());
    }

    private static final long serialVersionUID = 1647149933365643123L;

    @Override
    protected FormFieldFactory getFormFieldFactory() {
        return new CourseFieldFactory();
    }

    @Override
    protected Object[] getVisibleItemProperties() {
        return new Object[] { "name", "par", "holes" };
    }

    @Override
    protected void setTableHeaders() {
        table.setColumnHeader("name", Lang.getMessage("course name"));
        table.setColumnHeader("par", Lang.getMessage("course par"));
        table.setColumnHeader("holes", Lang.getMessage("course holes"));
    }

}
